package nc.itf.med.mcm.qdkc;

import java.util.HashMap;
import java.util.Map;

import nc.bs.framework.common.NCLocator;
import nc.itf.mcm.pub.constant.CommonCons;

public class QdkcTool {

	private static IQdkc service = null;

	private static Map<String, String> kc_qyrq = null;

	public static IQdkc getService() {
		if (service == null) {
			service = (IQdkc) NCLocator.getInstance().lookup(IQdkc.class);
		}
		return service;
	}

	public static final String getKcQyrq(String pk_corp) {
		if (pk_corp == null) {
			return CommonCons.kc_qyrq_default;
		}
		if (kc_qyrq == null) {
			kc_qyrq = new HashMap<String, String>();
		}
		if (kc_qyrq.containsKey(pk_corp)) {
			return kc_qyrq.get(pk_corp);
		} else {
			String temp = null;
			try {
				temp = getService().getKcQyrq(pk_corp);
			} catch (Exception e) {

			}
			if (temp == null) {
				temp = CommonCons.kc_qyrq_default;
			}
			kc_qyrq.put(pk_corp, temp);
			return temp;
		}
	}

}
